package com.example.demo.controller;

import com.example.demo.ao.DistinctAo;
import com.example.demo.service.DistinctService;
import com.example.demo.vo.DistinctVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/distinct")
@Slf4j
public class DistinctController {

    @Autowired
    private DistinctService distinctService;


    //双重遍历
    @PostMapping("/getDistinctInfo")
    public List<DistinctVo> getDistinctInfo(@RequestBody DistinctAo distinctAo){
        return distinctService.getDistinctInfo(distinctAo);
    }



    //双指针
    @PostMapping("/distinctInfo")
    public List<DistinctVo> distinctInfo(@RequestBody DistinctAo distinctAo){
        return distinctService.distinctInfo(distinctAo);
    }

}
